package com.nsoft.server.master.beans;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.nsoft.server.register.beans.BillingHeader;
import com.nsoft.server.register.beans.GcFooter;

@Entity
@Table(name = "account_master")
public class AccountMaster implements Serializable {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "acc_num_id")
	private int accNumId;

	@Column(name = "acc_char_code")
	private String accCharCode;

	@Column(name = "acc_char_name")
	private String accCharName;

	@Column(name = "acc_num_atype")
	private int accNumAtype;
	
	@OneToMany(mappedBy="accountMaster")
	private Set<BillingHeader> billingDetailCollection;

	public Set<BillingHeader> getBillingDetailCollection() {
		return billingDetailCollection;
	}

	public void setBillingDetailCollection(
			Set<BillingHeader> billingDetailCollection) {
		this.billingDetailCollection = billingDetailCollection;
	}

	@ManyToOne(fetch = FetchType.LAZY, optional = false)
	 @JoinColumn(name = "acc_num_partyId") 
	/*@JoinColumns( { @JoinColumn(name = "acc_num_partyId",
			referencedColumnName = "Party_num_id"),
			@JoinColumn(nullable=false, name="Party_char_Name"),
			@JoinColumn(nullable=false, name="Party_char_TAN"),
			@JoinColumn(nullable=false, name="Party_char_TIN"),
			@JoinColumn(nullable=false, name="Party_char_exim"),
			@JoinColumn(nullable=false, name="Party_char_PAN")
			//,insertable = false, updatable = false)
		 })*/	
	private PartyMaster party;

	public PartyMaster getParty() {
		return party;
	}

	public void setParty(PartyMaster party) {
		this.party = party;
	}

	/*
	 * @Column(name="acc_num_partyId") private int accNumPartyid;
	 */
	@Column(name = "acc_date_created")
	private Date accDateCreated;

	@Column(name = "acc_date_opendate")
	private Date accDateOpendate;

	@Column(name = "acc_cur_openbal")
	private int accCurOpenbal;

	@Column(name = "acc_cur_balance")
	private int accCurBalance;

	@Column(name = "acc_cur_limits")
	private int accCurLimits;

	@Column(name = "acc_char_notes")
	private String accCharNotes;

	@Column(name = "acc_date_updatedon")
	private Date accDateUpdatedon;

	@Column(name = "acc_char_selectable")
	private Boolean accCharSelectable;
	
	public Set<GcFooter> getGcSet() {
		return gcSet;
	}

	public void setGcSet(Set<GcFooter> gcSet) {
		this.gcSet = gcSet;
	}

	@OneToMany(mappedBy="gcaccountMaster")
	private Set<GcFooter> gcSet;

	private static final long serialVersionUID = 1L;

	public AccountMaster() {
		super();
	}

	public int getAccNumId() {
		return this.accNumId;
	}

	public void setAccNumId(int accNumId) {
		this.accNumId = accNumId;
	}

	public String getAccCharCode() {
		return this.accCharCode;
	}

	public void setAccCharCode(String accCharCode) {
		this.accCharCode = accCharCode;
	}

	public String getAccCharName() {
		return this.accCharName;
	}

	public void setAccCharName(String accCharName) {
		this.accCharName = accCharName;
	}

	public int getAccNumAtype() {
		return this.accNumAtype;
	}

	public void setAccNumAtype(int accNumAtype) {
		this.accNumAtype = accNumAtype;
	}

	/*
	 * public int getAccNumPartyid() { return this.accNumPartyid; }
	 * 
	 * public void setAccNumPartyid(int accNumPartyid) { this.accNumPartyid =
	 * accNumPartyid; }
	 */
	public Date getAccDateCreated() {
		return this.accDateCreated;
	}

	public void setAccDateCreated(Date accDateCreated) {
		this.accDateCreated = accDateCreated;
	}

	public Date getAccDateOpendate() {
		return this.accDateOpendate;
	}

	public void setAccDateOpendate(Date accDateOpendate) {
		this.accDateOpendate = accDateOpendate;
	}

	public int getAccCurOpenbal() {
		return this.accCurOpenbal;
	}

	public void setAccCurOpenbal(int accCurOpenbal) {
		this.accCurOpenbal = accCurOpenbal;
	}

	public int getAccCurBalance() {
		return this.accCurBalance;
	}

	public void setAccCurBalance(int accCurBalance) {
		this.accCurBalance = accCurBalance;
	}

	public int getAccCurLimits() {
		return this.accCurLimits;
	}

	public void setAccCurLimits(int accCurLimits) {
		this.accCurLimits = accCurLimits;
	}

	public String getAccCharNotes() {
		return this.accCharNotes;
	}

	public void setAccCharNotes(String accCharNotes) {
		this.accCharNotes = accCharNotes;
	}

	public Date getAccDateUpdatedon() {
		return this.accDateUpdatedon;
	}

	public void setAccDateUpdatedon(Date accDateUpdatedon) {
		this.accDateUpdatedon = accDateUpdatedon;
	}

	public Boolean getAccCharSelectable() {
		return this.accCharSelectable;
	}

	public void setAccCharSelectable(Boolean accCharSelectable) {
		this.accCharSelectable = accCharSelectable;
	}

}
